#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	
	int arr[] = { 1,1,2,2,3,3,4,4,5,6 };
	int num = sizeof(arr) / sizeof(arr[0]);
	int ret = 0;
	for (int i = 0; i < num; i++)
	{
		scanf("%d", &arr[i]);
		ret ^= arr[i];
} //init
	
	int n = 0;
	for (int i = 32; i > 0; i--)
	{
		if ((1 << i) & ret)
			n = i;
	}
	int s = 0;
	int d = 0;
	for (int i = 0; i < num; i++)
	{
		if ((1 << n) & arr[i])
			s ^= arr[i];
		else
			d^= arr[i];
	}
	
	

	printf("%d  %d\n", s, d);
	return 0;
}